fixing all bugs. adding validations and rotation support.