Updated code for library compilation