Type declaration added. Run and tested width dialyzer.