forked from http://sourceforge.net/projects/flsmac/