Completed shape determination function.