Replaced all solutions

Re-wrote all the implementation so far.