Added some preprocessing stuff