changed from tutorial