added some magic. removed some ugly