completed implementing, fixing minor bugs