Removed unnecessary part, added algo to comments