removed compile warnings
got rid of unused vars