Added basic preprocessing functionality