fixing and simplifying