Added decimal conversion and parameter range checking, modified input and output procedures