not proud of myself, but it works for now