update: working now, needs refactor