completed basic implementation & fixed bugs