Cleaned up the code and made sure it works.
Also added the packges config to make setup easier.