updated to work more dynamically! :)