added application file and some bug fixes