corrected typos, added todos, tried to harmonise return values