Complete overhaul and fixing of the applicaition