added AppCompat lib and simplified code