Cleaned up the module a little; better initialisation