First Working ver(should still have bugs)