Updated so it works standalone and on wakari without any modifications