Made some fixes and playing around with the code