works but is full of gavnocode