fixed code and added reflections