rearranged code so subroutines come first
changed dim_data to include more
document known feature
get rid of tabulation