WIP

Todo: comments and changes to line 132/133