Basic application with states