cleaned up code for ps5