minor bug fixes

removed $x$ constants in favour of hard coded strings
added return statement to optimise slightly