Really hacky but it works