added orientation support, comments and bugs