Removed apply, added source & sink functions, tested read+write mode