not working but a little cleaner than last commit