added props. Cleaned up code