Cleaned up code, added feedback function that can later give proper feedback