Fixed bugs. Application works for now!