start working on shape recognition
fix rect handling