Cleaning up and reworked it abit