Solved #39. Refactored #21; also removed #21 unit tests util I refactor to improve speed.