ugly but working(kinda..)