making it work both as a screen saver and an app