better code, thx to @Psycojoker