Added .idea and code improvement