CFY-509 fixed... whatever needed to be fixed. and now the code is nicer as well