refactored shapes and added some tests