Changed the order to be more logical, added little documentation