Added due credit to James for funcparse.pl