Need prettyfying but solves the problem