second attempt to completely rewrite the app