changed from file to filepath
improved tests