Using @meridithblevins code as starting point