Code now detects current working directory (not hard coded)