got something working but not pretty