Kind of hacky but works