code drawing 116a by RafaelFajardo