cleaned up janky code