fixed alignment problem; still need to work on finding tangent when there is no corner