ok i give up. I'll just use provided code. It's actually pretty nice... and it works