Kinda complete, works in current implementation