Added imports and fixed 'self' usage to allow app to run properly.