added md5 and restructured slightly