kinda working. needs cleanup.